package com.ns.dcjh.enums;


import com.ns.dcjh.R;

public enum TextColorEnum {

    WHITE(  "白色", R.color.white,1011),
    GRAY(  "灰色",R.color.gray,1012),
    ORANGE("橙色",R.color.orange,1013),
    RED("红色",R.color.red,1014),
    BLUE("蓝色",R.color.dark_blue,1015),
    GREEN("绿色",R.color.green,1016),
    BLACK("黑色",R.color.black,1017);

    private String colorName;
    private int colorRes;
    private int colorType;

    TextColorEnum(String colorName, int colorRes, int colorType){
        this.colorName = colorName;
        this.colorRes = colorRes;
        this.colorType = colorType;
    }

    public String getColorName() {
        return colorName;
    }

    public int getColorRes() {
        return colorRes;
    }

    public int getColorType() {
        return colorType;
    }


    public static int getColorByType(int colorType) {
        int colorRes = -1;
        TextColorEnum[] list = values();
        for (TextColorEnum textColor : list) {
            if (colorType == textColor.getColorType()) {
                colorRes = textColor.getColorRes();
            }
        }
        return colorRes;
    }

}
